package com.example.mvp.presenter;

import com.example.mvp.model.IModel;
import com.example.mvp.view.IView;

public class BasePresenter<M extends IModel,V extends IView> implements IPresenter {

    protected M mmodel;
    protected V mview;

    public BasePresenter(M mmodel, V mview) {
        this.mmodel = mmodel;
        this.mview = mview;
    }

    @Override
    public void destory() {
        if(mmodel!=null){
            mmodel.destory();
            mmodel=null;
        }

        if(mview!=null){
            mview=null;
        }
        System.gc();
    }
}
